package com.ymatou.iapi.productcategory.service;

import org.json.JSONObject;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;


public class GetProductCategoryByCategoryIdCall extends YmatouBaseCall{
	private static String opurl ="api/Category/GetProductCategoryByCategoryId";
	
	public GetProductCategoryByCategoryIdCall() {
		super(EnvSetup.getSystemUrl("productcategory_iapi"),opurl,"GET","PARAM");
	}
	/**
	 * @param domain EnvSetup.getSystemUrl("productcategory_iapi") or EnvSetup.getSystemUrl("productcategory_api") 用于新旧站点
	 */
	public GetProductCategoryByCategoryIdCall(String domain) {
		super(domain,opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public JsonObject getData() {
		return getJsonObject().getAsJsonObject("Data").getAsJsonObject("ProductCategory");
	}
}
